﻿@using Utry.Framework.Mvc
@using Utry.Framework.Configuration;
@model Utry.CI.Models.ProjectModel
﻿@{
    ViewBag.Title = "CI | 项目详情";
}

<div style="margin-top:39px;">

 <div class="tab-pane" >

           @Html.JPartial("_Notifications")

          <!--有用代码-->
    <div class="portlet" style=" border: 0px ;">   
                  <div class="portlet-body" style="padding:0px;">
                     <ul  class="nav nav-tabs">
                        <li >
                            <i class="icon-reorder"></i><span style="font-size:16px; font-weight:bold; padding-right:20px;">@Model.Project.ProjectName</span> 
                            <select id="ddlpro" class="select2_category form-control" style="width:200px;">
                                @foreach (var item in Model.ProjectList)
                                {
                                    <option value="@item.ID">@item.ProjectName</option>
                                }
                             </select>
                        </li>
                        <li class="active" style="float:right"><a  href="@Url.Action("ProjectVersionDownLoad", "Project", new { id = Model.Project.ID })" data-toggle="tab">版本下载</a></li>
                        <li class="" style="float:right"><a href="@Url.Action("ProjectReleaseInfo", "Project", new { id = Model.Project.ID })" >版本发布</a></li>
                        <li class="" style="float:right"><a  href="@Url.Action("ProjectReviewInfo", "Project", new { id = Model.Project.ID })" >需求评审</a></li>
                        <li class="" style="float:right"><a  href="@Url.Action("ProjectInfo", "Project", new { id= Model.Project.ID })" >基本信息</a></li>
                     </ul>
                     <div  class="tab-content">
                    <form name="form1" method="post" action="@Url.Action("ProjectVersionDownLoad", "Project", new { id = Model.Project.ID })" >
                            <div class="table-toolbar">
                                  <div class="btn-group">
           	                            <input type="text" name="BeginDate" id="BeginDate" placeholder="开始时间" value="@Model.BeginDate" class="form-control datefrom" style="width:130px;"/>
                                  </div>

                                  <div class="btn-group">
           	                            <input type="text" name="EndDate" id="EndDate" placeholder="结束时间" value="@Model.EndDate" class="form-control dateto" style="width:130px;"/>
                                  </div>

                                  <div class="btn-group">
                                        <button type="button" class="btn btn-sm btn-success" onclick="query()"><i class="icon-search"></i></button>                                  </div>
   
                      
                            </div>
                        
                            <table class="table table-striped table-bordered table-hover" id="projectlist">
                              <thead>
                                <tr>
                                  <th>版本时间</th>
                                  <th>版本类型</th>
                                  <th>版本地址</th>
                                </tr>
                              </thead>
                              <tbody>

                               @foreach (var item in Model.ReleaseList)
                               {
                                <tr>
                                 <td>@item.EndTime </td>
                                 <td>@item.Type</td>
                                 <td>
                                 @if (!string.IsNullOrEmpty(item.VersionURL))
                                 { 
                                 <a href="@ConfigHelper.GetValue("CI_Release_Uri")@item.VersionURL" >@item.VersionURL.Substring(item.VersionURL.LastIndexOf("/") + 1)</a>
                                 }
                                 </td>
                                </tr>
                               }

                              </tbody>
                            </table>
                        <div id="pager"><ul class="pagination">@Html.Pager(Model.PageList).ShowIndividualPages(true)</ul> </div>
                        </form>
                     </div>
                  </div>
               </div>
 </div>

</div>
<script type="text/javascript">
    jQuery(document).ready(function () {
        // initiate layout and plugins
        App.init();
        FormSamples.init();
    });
    $(document).ready(function () {
        $("#ddlpro").change(function () {
            var url = $("#ddlpro").val();
            var index = $("#ddlpro").get(0).selectedIndex;
            //alert(index);
            window.location.href = "/Project/ProjectVersionDownLoad?id=" + url;
        });
    });
    //查询
    function query() {
        document.forms[0].action = '@Url.Action("ProjectVersionDownLoad", "Project", new { id = Model.Project.ID })';
        document.forms[0].method = 'post';
        document.forms[0].submit();
    }

    $(".datefrom").datetimepicker({ format: 'yyyy-mm-dd hh:ii', autoclose: true });
    $(".dateto").datetimepicker({ format: 'yyyy-mm-dd hh:ii', autoclose: true });
</script>
